#simple mesure rapide sans synchronisation


import visa
import re
import time
import numpy as np


AgilentV = visa.instrument("GPIB::2")
print "Mesure de tension", AgilentV.ask("*IDN?")


KeithleyI = visa.instrument("GPIB::7")
print "Mesure de courant"

numit=10
R=np.zeros(10)

for i in range(10):
    I=KeithleyI.ask_for_values("MEAS:AMP:DC?")
    V=AgilentV.ask_for_values("MEAS:VOLT:DC?")
     
    R[i]=V[0]/I[0]
    time.sleep(0.5)

print "Moyenne", np.mean(R)*1000 , "mOhm"
print "Variance", np.var(R)*1000 , "mOhm"


    

